<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:include="common/common_head :: commonHead('系统任务管理')"></head>
</head>
<body class="larryms-auth">
<div class="layui-row larryms-panel">
    <div class="larryms-panel-heading layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12">
        <span class="panel-tit">系统任务列表</span>
    </div>
    <div class="larryms-panel-body layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12">
        <div class="larryms-tools">
            <form id="queryForm">
                <div class="larryms-search-box">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" height="20px" id="jobName"
                                   name="jobName" autocomplete="off" placeholder="任务名称"/>
                        </div>
                        <a class="layui-btn larryms-search" id="searchBtn" data-type="query"
                             data-form="queryForm"><i class="layui-icon layui-icon-search"></i>搜索</a>
                        <a class="layui-btn larryms-search" id="reloadBtn" data-type="reload"
                           data-form="queryForm"><i class="layui-icon layui-icon-refresh"></i></a>
                    </div>
                </div>
            </form>
            <div class="larryms-btn-group" style="margin-top:10px">
                <button class="layui-btn layui-btn-sm layui-btn-normal"  data-type="add" data-title="新增任务"  th:attr="data-url=@{/system/job/showAdd}">
                    <i class="layui-icon">&#xe61f;</i><cite>增加</cite></button>
                <button class="layui-btn layui-btn-sm" data-type="update"  data-title="修改任务" th:attr="data-url=@{/system/job/showUpdate}">
                    <i class="layui-icon">&#xe642;</i><cite>编辑</cite></button>
                <button class="layui-btn layui-btn-sm layui-btn-primary" data-type="detail" data-title="查看任务详情"
                        th:attr="data-url=@{/system/job/showUpdate}">
                    <i class="larry-icon larry-file-markdown"></i><cite>查看</cite></button>
            </div>
        </div>
        <div class="user-list layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12">
            <table id="jobList" lay-filter="jobList" class="larryms-table-id"
                   th:attr="data-url=@{/system/job/list}"></table>
        </div>
    </div>
</div>
<script type="text/html" id="toolBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail" data-title="查看任务详情"
       th:attr="data-url=@{/system/job/showUpdate}"><i class="larry-icon larry-file-markdown"></i>查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit" th:attr="data-url=@{/system/job/showUpdate}" data-title="修改任务">
        <i class="layui-icon">&#xe642;</i>编辑</a>
    {{#  if(d.status == 0){ }}
    <a class="layui-btn layui-btn-xs  layui-btn-normal" lay-event="start" th:attr="data-url=@{/system/job/startJob}">
        <i class="layui-icon">&#xe652;</i>启动</a>
    {{#  } }}
    {{# if(d.status == 1){ }}
    <a class="layui-btn layui-btn-xs  layui-btn-normal" lay-event="end" th:attr="data-url=@{/system/job/endJob}">
        <i class="layui-icon layui-icon-close"></i>停止</a>
    {{#  } }}
    <a class="layui-btn layui-btn-xs  layui-btn-warm" lay-event="run" th:attr="data-url=@{/system/job/runJob}">
        <i class="layui-icon layui-icon-util"></i>手动执行</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" th:attr="data-url=@{/system/job/delete}">
        <i class="layui-icon layui-icon-delete"></i>删除</a>
</script>
<script type="text/javascript" th:src="@{/static/larryms/layui/layui.js}"/>
<script>
    var table, bathPath = /*[[@{/}]]*/ "/";
    layui.cache.page = "task";
    layui.config({
        version: ui.version,
        base: bathPath + 'static/larryms/',  //实际使用时，建议改成绝对路径
        rightMenu: "none" // false关闭，设置为custom时使用自定义，不使用默认menu
    }).extend({
        larry:'js/base'
    }).use('larry');
</script>
</body>
</html>